const KoaRouter = require('koa-router')
const departmentService = require('../service/departmentService.js')
const code = require('../common/code')
const auth = require('../middleware/auth')

const router = new KoaRouter()

router.get('/departmentList', auth(['EDP']), async ctx => {
    ctx.body = code.getCode(code.SUCCESS, null, await departmentService.getDepartmentList())
})

module.exports = router
